.class public Lcom/netease/newsreader/view/VoteGallery;
.super Landroid/widget/FrameLayout;
.source "VoteGallery.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemSelectedListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/FrameLayout;",
        "Landroid/widget/AdapterView$OnItemSelectedListener;"
    }
.end annotation


# instance fields
.field private mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

.field private mContext:Landroid/content/Context;

.field private mGallery:Lcom/netease/newsreader/view/MyGallery;

.field private mIndicator:Lcom/netease/newsreader/view/VoteDotIndicator;

.field private mVoteButton:Landroid/widget/Button;

.field private map:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field private themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

.field public voteDoListener:Landroid/view/View$OnClickListener;

.field public voteSeeListener:Landroid/view/View$OnClickListener;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 58
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 161
    new-instance v0, Lcom/netease/newsreader/view/VoteGallery$1;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/view/VoteGallery$1;-><init>(Lcom/netease/newsreader/view/VoteGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->voteSeeListener:Landroid/view/View$OnClickListener;

    .line 199
    new-instance v0, Lcom/netease/newsreader/view/VoteGallery$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/view/VoteGallery$2;-><init>(Lcom/netease/newsreader/view/VoteGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->voteDoListener:Landroid/view/View$OnClickListener;

    .line 59
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 54
    invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 161
    new-instance v0, Lcom/netease/newsreader/view/VoteGallery$1;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/view/VoteGallery$1;-><init>(Lcom/netease/newsreader/view/VoteGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->voteSeeListener:Landroid/view/View$OnClickListener;

    .line 199
    new-instance v0, Lcom/netease/newsreader/view/VoteGallery$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/view/VoteGallery$2;-><init>(Lcom/netease/newsreader/view/VoteGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->voteDoListener:Landroid/view/View$OnClickListener;

    .line 55
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    .line 50
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 161
    new-instance v0, Lcom/netease/newsreader/view/VoteGallery$1;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/view/VoteGallery$1;-><init>(Lcom/netease/newsreader/view/VoteGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->voteSeeListener:Landroid/view/View$OnClickListener;

    .line 199
    new-instance v0, Lcom/netease/newsreader/view/VoteGallery$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/view/VoteGallery$2;-><init>(Lcom/netease/newsreader/view/VoteGallery;)V

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->voteDoListener:Landroid/view/View$OnClickListener;

    .line 51
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/view/VoteGallery;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 45
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/view/VoteGallery;)Ljava/util/Map;
    .locals 1
    .parameter

    .prologue
    .line 112
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    return-object v0
.end method

.method private updateDisplay(I)V
    .locals 12
    .parameter "position"

    .prologue
    .line 114
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    .line 115
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    invoke-virtual {v1, p1}, Lcom/netease/newsreader/adapter/VoteAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map;

    iput-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    .line 117
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    if-nez v1, :cond_0

    .line 156
    :goto_0
    return-void

    .line 119
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    const-string v3, "vote_id"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    .line 120
    .local v11, voteId:Ljava/lang/String;
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    invoke-virtual {v1, v11}, Landroid/widget/Button;->setTag(Ljava/lang/Object;)V

    .line 122
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v8

    check-cast v8, Lcom/netease/newsreader/activity/MyApplication;

    .line 123
    .local v8, app:Lcom/netease/newsreader/activity/MyApplication;
    invoke-virtual {v8}, Lcom/netease/newsreader/activity/MyApplication;->getSQLiteDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 124
    .local v0, db:Landroid/database/sqlite/SQLiteDatabase;
    const-string v1, "vote_table"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    const-string v4, "vote_id"

    aput-object v4, v2, v3

    .line 125
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "vote_id="

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    const-string v7, "auto_id desc"

    .line 124
    invoke-virtual/range {v0 .. v7}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v9

    .line 127
    .local v9, cur:Landroid/database/Cursor;
    invoke-interface {v9}, Landroid/database/Cursor;->getCount()I

    move-result v10

    .line 128
    .local v10, flag:I
    invoke-interface {v9}, Landroid/database/Cursor;->close()V

    .line 130
    if-nez p1, :cond_2

    .line 131
    if-lez v10, :cond_1

    .line 132
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0b0039

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 133
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->voteSeeListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 134
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f020086

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/content/Context;Landroid/view/View;I)V

    .line 135
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f080027

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    goto/16 :goto_0

    .line 137
    :cond_1
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0b0038

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 138
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->voteDoListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 139
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f020086

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/content/Context;Landroid/view/View;I)V

    .line 140
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f080027

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    goto/16 :goto_0

    .line 143
    :cond_2
    if-lez v10, :cond_3

    .line 144
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0b0039

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 145
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->voteSeeListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 146
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f020086

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/content/Context;Landroid/view/View;I)V

    .line 147
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f080027

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    goto/16 :goto_0

    .line 149
    :cond_3
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0b0039

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 150
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->voteSeeListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 151
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f020086

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/content/Context;Landroid/view/View;I)V

    .line 152
    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v4, 0x7f080027

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    goto/16 :goto_0
.end method


# virtual methods
.method public getGallery()Landroid/widget/Gallery;
    .locals 1

    .prologue
    .line 76
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    return-object v0
.end method

.method protected onDetachedFromWindow()V
    .locals 3

    .prologue
    .line 291
    invoke-super {p0}, Landroid/widget/FrameLayout;->onDetachedFromWindow()V

    .line 292
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    if-eqz v0, :cond_0

    .line 293
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    invoke-virtual {v0}, Lcom/netease/newsreader/adapter/VoteAdapter;->getCount()I

    move-result v0

    if-lez v0, :cond_0

    .line 294
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    invoke-virtual {v2}, Lcom/netease/newsreader/view/MyGallery;->getSelectedItemPosition()I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/netease/newsreader/adapter/VoteAdapter;->getInitPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/view/MyGallery;->setSelection(I)V

    .line 297
    :cond_0
    return-void
.end method

.method protected onFinishInflate()V
    .locals 2

    .prologue
    .line 63
    invoke-super {p0}, Landroid/widget/FrameLayout;->onFinishInflate()V

    .line 64
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteGallery;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    .line 65
    const v0, 0x7f0c016c

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/VoteGallery;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/view/MyGallery;

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    .line 66
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/view/MyGallery;->setAutoRun(I)V

    .line 67
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    invoke-virtual {v0, p0}, Lcom/netease/newsreader/view/MyGallery;->setOnItemSelectedListener(Landroid/widget/AdapterView$OnItemSelectedListener;)V

    .line 69
    const v0, 0x7f0c016d

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/VoteGallery;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/view/VoteDotIndicator;

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mIndicator:Lcom/netease/newsreader/view/VoteDotIndicator;

    .line 70
    const v0, 0x7f0c0032

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/view/VoteGallery;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    .line 72
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    .line 73
    return-void
.end method

.method public onItemSelected(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 3
    .parameter
    .parameter "arg1"
    .parameter "position"
    .parameter "arg3"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 94
    .local p1, adapter:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    invoke-virtual {v2}, Lcom/netease/newsreader/adapter/VoteAdapter;->getRealCount()I

    move-result v0

    .line 95
    .local v0, count:I
    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    invoke-virtual {v2, p3}, Lcom/netease/newsreader/adapter/VoteAdapter;->getRealPosition(I)I

    move-result v1

    .line 96
    .local v1, realPosition:I
    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mIndicator:Lcom/netease/newsreader/view/VoteDotIndicator;

    invoke-virtual {v2}, Lcom/netease/newsreader/view/VoteDotIndicator;->getTotalItems()I

    move-result v2

    if-eq v2, v0, :cond_0

    .line 97
    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mIndicator:Lcom/netease/newsreader/view/VoteDotIndicator;

    invoke-virtual {v2, v0}, Lcom/netease/newsreader/view/VoteDotIndicator;->setTotalItems(I)V

    .line 99
    :cond_0
    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mIndicator:Lcom/netease/newsreader/view/VoteDotIndicator;

    invoke-virtual {v2, v1}, Lcom/netease/newsreader/view/VoteDotIndicator;->setCurrentItem(I)V

    .line 101
    invoke-direct {p0, v1}, Lcom/netease/newsreader/view/VoteGallery;->updateDisplay(I)V

    .line 110
    return-void
.end method

.method public onNothingSelected(Landroid/widget/AdapterView;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;)V"
        }
    .end annotation

    .prologue
    .line 242
    .local p1, arg0:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    return-void
.end method

.method protected onWindowVisibilityChanged(I)V
    .locals 3
    .parameter "visibility"

    .prologue
    .line 281
    invoke-super {p0, p1}, Landroid/widget/FrameLayout;->onWindowVisibilityChanged(I)V

    .line 282
    if-nez p1, :cond_0

    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteGallery;->isShown()Z

    move-result v0

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    if-eqz v0, :cond_1

    .line 283
    :cond_0
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    invoke-virtual {v0}, Lcom/netease/newsreader/adapter/VoteAdapter;->getCount()I

    move-result v0

    if-lez v0, :cond_1

    .line 284
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    iget-object v2, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    invoke-virtual {v2}, Lcom/netease/newsreader/view/MyGallery;->getSelectedItemPosition()I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/netease/newsreader/adapter/VoteAdapter;->getInitPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/view/MyGallery;->setSelection(I)V

    .line 287
    :cond_1
    return-void
.end method

.method protected seeVoteResult()V
    .locals 5

    .prologue
    .line 181
    new-instance v1, Landroid/content/Intent;

    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    const-class v4, Lcom/netease/newsreader/activity/VoteSubmit;

    invoke-direct {v1, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 182
    .local v1, intent:Landroid/content/Intent;
    const/high16 v3, 0x1000

    invoke-virtual {v1, v3}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 183
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 184
    .local v0, b:Landroid/os/Bundle;
    new-instance v2, Lcom/netease/newsreader/bean/VoteBean;

    invoke-direct {v2}, Lcom/netease/newsreader/bean/VoteBean;-><init>()V

    .line 186
    .local v2, vb:Lcom/netease/newsreader/bean/VoteBean;
    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    const-string v4, "vote_id"

    invoke-interface {v3, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/netease/newsreader/bean/VoteBean;->setId(Ljava/lang/String;)V

    .line 187
    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    const-string v4, "voteitem"

    invoke-interface {v3, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/List;

    invoke-virtual {v2, v3}, Lcom/netease/newsreader/bean/VoteBean;->setItemLsit(Ljava/util/List;)V

    .line 188
    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->map:Ljava/util/Map;

    const-string v4, "question"

    invoke-interface {v3, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/netease/newsreader/bean/VoteBean;->setItemQuestion(Ljava/lang/String;)V

    .line 190
    const-string v3, "votebean"

    invoke-virtual {v0, v3, v2}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    .line 191
    const-string v3, "already_vote"

    const/4 v4, 0x1

    invoke-virtual {v0, v3, v4}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 192
    const-string v3, "vb"

    invoke-virtual {v1, v3, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;

    .line 193
    iget-object v3, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    invoke-virtual {v3, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 194
    return-void
.end method

.method public setAdapter(Lcom/netease/newsreader/adapter/VoteAdapter;)V
    .locals 3
    .parameter "adapter"

    .prologue
    .line 80
    iput-object p1, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    .line 81
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    invoke-virtual {v0, p1}, Lcom/netease/newsreader/view/MyGallery;->setAdapter(Landroid/widget/SpinnerAdapter;)V

    .line 82
    if-eqz p1, :cond_0

    .line 83
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mAdapter:Lcom/netease/newsreader/adapter/VoteAdapter;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/netease/newsreader/adapter/VoteAdapter;->getInitPosition(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/netease/newsreader/view/MyGallery;->setSelection(I)V

    .line 86
    :cond_0
    return-void
.end method

.method public setIndicator(Landroid/content/Context;Lcom/netease/newsreader/util/ThemeSettingsHelper;)V
    .locals 3
    .parameter "context"
    .parameter "themeSettingsHelper"

    .prologue
    .line 252
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mIndicator:Lcom/netease/newsreader/view/VoteDotIndicator;

    invoke-virtual {v0, p1, p2}, Lcom/netease/newsreader/view/VoteDotIndicator;->setIndicatorBg(Landroid/content/Context;Lcom/netease/newsreader/util/ThemeSettingsHelper;)V

    .line 254
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v2, 0x7f020086

    invoke-virtual {p2, v0, v1, v2}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/content/Context;Landroid/view/View;I)V

    .line 255
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/netease/newsreader/view/VoteGallery;->mVoteButton:Landroid/widget/Button;

    const v2, 0x7f080027

    invoke-virtual {p2, v0, v1, v2}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 264
    return-void
.end method

.method public setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V
    .locals 1
    .parameter

    .prologue
    .line 89
    .local p1, listener:Landroid/widget/AdapterView$OnItemClickListener;,"Landroid/widget/AdapterView$OnItemClickListener;"
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    invoke-virtual {v0, p1}, Lcom/netease/newsreader/view/MyGallery;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 90
    return-void
.end method

.method public startAutoScroll(Z)V
    .locals 1
    .parameter "autoScroll"

    .prologue
    .line 245
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    if-eqz v0, :cond_0

    .line 246
    iget-object v0, p0, Lcom/netease/newsreader/view/VoteGallery;->mGallery:Lcom/netease/newsreader/view/MyGallery;

    invoke-virtual {v0, p1}, Lcom/netease/newsreader/view/MyGallery;->startAutoScroll(Z)V

    .line 248
    :cond_0
    return-void
.end method
